<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
RunScript
</title><link rel="stylesheet" type="text/css" href="../../../stylesheet.css" />
<script type="text/javascript" src="../../../animate.js"></script>
</head><body onload="openLink();">
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<h1>RunScript</h1>
Runs a SQL script against a database.<br /><br />
<table class="block"><tr onclick="return allDetails()"><th colspan="2">Methods</th></tr>
<tr id="__0" onclick="return on(0)">
<td class="return">static ResultSet</td><td class="method">
<a id="execute_Connection_Reader" href="#execute_Connection_Reader">execute</a>(Connection conn, Reader reader)
<div class="methodText">Executes the SQL commands read from the reader against a database.</div>
</td></tr>
<tr onclick="return off(0)" class="detail" id="_0">
<td class="return">static ResultSet</td><td>
<a id="execute_Connection_Reader" href="#execute_Connection_Reader">execute</a>(Connection conn, Reader reader) throws SQLException
<div class="methodText">Executes the SQL commands read from the reader against a database.</div>
<div class="itemTitle">Parameters:</div>
<div class="item">conn - the connection to a database</div>
<div class="item">reader - the reader</div>
<div class="itemTitle">Returns:</div>
<div class="item">the last result set</div>
</td></tr>
<tr id="__1" onclick="return on(1)">
<td class="return">static void</td><td class="method">
<a id="execute_String_String_String_String_String_boolean" href="#execute_String_String_String_String_String_boolean">execute</a>(String url, String user, String password, String fileName, String charsetName, boolean continueOnError)
<div class="methodText">Executes the SQL commands in a script file against a database.</div>
</td></tr>
<tr onclick="return off(1)" class="detail" id="_1">
<td class="return">static void</td><td>
<a id="execute_String_String_String_String_String_boolean" href="#execute_String_String_String_String_String_boolean">execute</a>(String url, String user, String password, String fileName, String charsetName, boolean continueOnError) throws SQLException
<div class="methodText">Executes the SQL commands in a script file against a database.</div>
<div class="itemTitle">Parameters:</div>
<div class="item">url - the database URL</div>
<div class="item">user - the user name</div>
<div class="item">password - the password</div>
<div class="item">fileName - the script file</div>
<div class="item">charsetName - the character set name or null for UTF-8</div>
<div class="item">continueOnError - if execution should be continued if an error occurs</div>
</td></tr>
<tr id="__2" onclick="return on(2)">
<td class="return">static void</td><td class="method">
<a id="main_String..." href="#main_String...">main</a>(String... args)
<div class="methodText">Options are case sensitive.</div>
</td></tr>
<tr onclick="return off(2)" class="detail" id="_2">
<td class="return">static void</td><td>
<a id="main_String..." href="#main_String...">main</a>(String... args) throws SQLException
<div class="methodText">Options are case sensitive. Supported options are:
 <table>
 <tr><td>[-help] or [-?]</td>
 <td>Print the list of options</td></tr>
 <tr><td>[-url "&lt;url&gt;"]</td>
 <td>The database URL (jdbc:...)</td></tr>
 <tr><td>[-user &lt;user&gt;]</td>
 <td>The user name (default: sa)</td></tr>
 <tr><td>[-password &lt;pwd&gt;]</td>
 <td>The password</td></tr>
 <tr><td>[-script &lt;file&gt;]</td>
 <td>The script file to run (default: backup.sql)</td></tr>
 <tr><td>[-driver &lt;class&gt;]</td>
 <td>The JDBC driver class to use (not required in most cases)</td></tr>
 <tr><td>[-showResults]</td>
 <td>Show the statements and the results of queries</td></tr>
 <tr><td>[-checkResults]</td>
 <td>Check if the query results match the expected results</td></tr>
 <tr><td>[-continueOnError]</td>
 <td>Continue even if the script contains errors</td></tr>
 <tr><td>[-options ...]</td>
 <td>RUNSCRIPT options (embedded H2; -*Results not supported)</td></tr>
 </table></div>
<div class="itemTitle">Parameters:</div>
<div class="item">args - the command line arguments</div>
</td></tr>
<tr id="__3" onclick="return on(3)">
<td class="return">void</td><td class="method">
<a id="runTool_String..." href="#runTool_String...">runTool</a>(String... args)
<div class="methodText">Executes the contents of a SQL script file against a database.</div>
</td></tr>
<tr onclick="return off(3)" class="detail" id="_3">
<td class="return">void</td><td>
<a id="runTool_String..." href="#runTool_String...">runTool</a>(String... args) throws SQLException
<div class="methodText">Executes the contents of a SQL script file against a database.
 This tool is usually used to create a database from script.
 It can also be used to analyze performance problems by running
 the tool using Java profiler settings such as:
 <pre>
 java -Xrunhprof:cpu=samples,depth=16 ...</pre>
 To include local files when using remote databases, use the special
 syntax:
 <pre>
 &#064;INCLUDE fileName</pre>
 This syntax is only supported by this tool. Embedded RUNSCRIPT SQL
 statements will be executed by the database.</div>
<div class="itemTitle">Parameters:</div>
<div class="item">args - the command line arguments</div>
</td></tr>
</table>
</div></td></tr></table></body></html>
